<template>
	<z-paging ref="paging" @query="queryList"  class="content" v-if="isshow">
		<!-- #ifdef APP-PLUS -->
		<view style="height: 125rpx;"></view>
		<!-- #endif -->
		<template slot='top'>
			<Header :isShowRight="false" title="发票包含订单" @back='back' arrowColor='#000' textColor='#000' bgColor="#fff"></Header>
		</template>
		<view style="margin-top: 40rpx;">
			<view class="item" v-for='(item,index) in list' :key='index'>
				<view class="courseImg">
					<image :src="item.coverImg" mode="" style="width:100%;height: 100%;"></image>
				</view>
				<view class="right">
					<view class="hiddenText">{{item.courseName}}</view>
					<view class="right_bottom">
						<view class="">{{item.createTime}}</view>
						<view class="bottom-right">
							<text style="color:#4A4A4A;font-size: 26rpx;">实付款</text>
							<text style="padding-left: 14rpx;">￥</text>
							<view class="money">{{item.totalMoney}}</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</z-paging>
	
</template>

<script>
	import {
		myOrderList
	} from '@/apis/apis.js'
	import Header from '@/components/c_header.vue'
	import {dateFormat} from '@/utils/date.js'
	export default{
		components: {
			Header
		},
		data(){
			return{
				list:[
				],
				id:'',//上一页面传的id
				isshow:false
			}
		},
		onShow() {
			this.isshow = true
		},
		onHide() {
			this.isshow = false
		},
		methods:{
			back(){
				uni.navigateBack({
					delta:1
				})
			},
			queryList(pageNo, pageSize) {
				myOrderList({
					invoiceFlag: 2,
					orderIds:this.id,
					pageNum: pageNo,
					pageSize: pageSize
				}).then(res=>{
					console.log(res);
					res.data.forEach(item=>{
						item.payMoney=item.payMoney.toFixed(1)
						item.createTime=dateFormat(item.createTime,'yyyy.MM.dd')
					})
					this.list=res.data
					this.$refs.paging.complete(res.data)
				})
			}
		},
		onLoad(options) {
			this.id=options.id
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		width: 100%;
		// height: 100vh;
		background: #F8F8F8;
		min-height: 100vh;
	
		.bg {
			width: 100%;
			height: 140rpx;
			padding: 76rpx 0 0 32rpx;
			background: #fff;
			margin-bottom: 40rpx;
		}
		.item{
			display: flex;
			width: 92%;
			margin: 0 auto;
			margin-bottom: 30rpx;
			padding: 25rpx 29rpx 28rpx 27rpx;
			box-shadow: 0 7rpx 27rpx 0 rgba(127,129,133,0.1);
			border-radius: 20rpx;
			background: #fff;
			.courseImg{
				// width: 220rpx;
				width: 251rpx;
				height: 147rpx;
				border-radius: 20rpx;
				padding-right:31rpx;
			}
			.right{
				width: 60%;
				display: flex;
				flex-direction: column;
				justify-content: space-between;
				.hiddenText{
					font-size: 30rpx;
					font-family: Source Han Sans CN;
					font-weight: 500;
					color: #111111;
					line-height: 44rpx;
					overflow: hidden;
					-webkit-line-clamp: 2;
					text-overflow: ellipsis;
					display: -webkit-box;
					-webkit-box-orient: vertical;
				}
				.right_bottom{
					display: flex;
					align-items: baseline;
					justify-content: space-between;
					font-size: 26rpx;
					font-family: Source Han Sans CN;
					color: #B2B2B2;
					.bottom-right{
						display: flex;
						align-items: baseline;
						font-size: 22rpx;
						color: #FFA025;
						.money{
							font-size: 36rpx;
							font-family: PingFang SC;
							font-weight: bold;
						}
					}
				}
			}
		}
	}
</style>